package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class ReadStringDemo {
    public static void main(String[] args) throws IOException {

        FileInputStream fis = new FileInputStream("./demo.txt");

        int len = fis.available();
        byte[] data = new byte[len];
        fis.read(data);
        String line = new String(data, StandardCharsets.UTF_8);
        System.out.println(line);
        fis.close();

    }
}
